package com.test.springboot.demo.controller;

import com.test.springboot.demo.pojo.HourRegistData;
import com.test.springboot.demo.service.CharService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.List;

@Controller
public class ChartController {
    @Autowired
    private CharService charService;

    @RequestMapping("test")
    public String chart() {
        return "chart";
    }

    @RequestMapping("regist")
    @ResponseBody
    public List<HourRegistData> data(Integer gameId, String date) {
        return charService.getHourRegistData(gameId, date);
    }
}
